#ifndef WXDIALOG_H
#define WXDIALOG_H

#include <string>
#include "sigslot.h"

class wxDialog
{
public:
    /// construction
    wxDialog();
    virtual ~wxDialog();

    /// possible states of the window
    enum State { Minimized, Normal, Maximized };

    /// maximize = true => maximize, otherwise - restore
    virtual void Maximize(bool maximize = true);

    /// undo Maximize() or Iconize()
    virtual void Restore();

    /// iconize = true => iconize, otherwise - restore
    virtual void Iconize(bool iconize = true);

    /// return true if the frame is maximized
    virtual bool IsMaximized() const;

    /// return true if the frame is iconized
    virtual bool IsIconized() const;

    /// maximize the window to cover entire screen
    virtual bool ShowFullScreen(bool show);

    /// return true if the frame is in fullscreen mode
    virtual bool IsFullScreen() const;

    /// sets the title of the dialog
    virtual void SetTitle(const std::string& title);

    /// gets the title of the dialog
    virtual std::string GetTitle() const;

    /// Is this the active frame (highlighted in the taskbar)?
    virtual bool IsActive() const;

    /// shows the dialog
    virtual bool Show(bool show = true);
    
    /// press a key
    virtual void KeyPress(char key);
    
    /// change the size of the window
    virtual void Size(int width, int height);
    
    /// close the window
    virtual void Close();
    
    /// press the OK button
    virtual void PressOK();
    
    /// press the Apply button
    virtual void PressApply();
    
    /// press the Cancel button
    virtual void PressCancel();
    
    /// event handlers
    sigslot::signal0<> Closed;
    sigslot::signal1<State> StateChanged;
    sigslot::signal2<int,int> Resized;
    sigslot::signal1<char> KeyPressed;
    sigslot::signal0<> OKed;
    sigslot::signal0<> Applied;
    sigslot::signal0<> Canceled;
    sigslot::signal0<> SysColourChanged;

protected:
    State m_state, m_state_prev;
    bool m_fullscreen;
    bool m_active;
    bool m_shown;
    std::string m_title;
    int m_width;
    int m_height;
};


#endif // WXDIALOG_H
